package com.hmall.api.client;

import com.hmall.api.client.fallback.PayClientFallback;
import com.hmall.api.dto.PayOrderDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

@FeignClient(value = "pay-service", fallbackFactory = PayClientFallback.class,path = "/pay-orders")
public interface PayClient {
    /**
     * 根据交易订单id查询支付单
     *
     * @param id 业务订单id
     * @return 支付单信息
     */
    @GetMapping("/biz/{id}")
    PayOrderDTO queryPayOrderByBizOrderNo(@PathVariable("id") Long id);

    /**
     * 根据订单id修改支付单状态为已取消
     *
     * @param orderId
     */
    @PutMapping("/{orderId}")
    public void updatePayOrderStatus(@PathVariable Long orderId);
}